<?php
namespace App\Controllers;

class Media extends BaseController
{
    // 处理/image/文件名路径请求，输出writable/data目录下的图片
    public function image($filename): void
    {
        // WRITEPATH是框架常量，指向项目的writable目录；拼接路径为writable/data/文件名
        readfile(filename: WRITEPATH . 'data/' . $filename);
    }
}